﻿using System;
using Zeus.Thunder.Core;

namespace SharpTrainer.Delegates
{
  class TestBubbleSorter : ITestCase
  {
    public void Run()
    {
        MyEmployee[] employees =
            {
              new MyEmployee("Bugs Bunny", 20000),
              new MyEmployee("Elmer Fudd", 10000),
              new MyEmployee("Daffy Duck", 25000),
              new MyEmployee("Wiley Coyote", 1000000.38),
              new MyEmployee("Foghorn Leghorn", 23000),
              new MyEmployee("RoadRunner'", 50000)};
      
      CompareOp employeeCompareOp = new CompareOp(DelegateAlgorithm.RhsIsGreater);
      DelegateAlgorithm.BubbleSorter(employees, employeeCompareOp);

      for (int i = 0; i < employees.Length; i++)
        Console.WriteLine(employees[i].ToString());
      Console.ReadLine();
    }
  }
}
